<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:t="http://myfaces.apache.org/tomahawk"> 
     <ui:composition template="./WEB-INF/Templates/templateProjeto.xhtml">
        <ui:define name="titulo">Consulta Participante</ui:define>
        <ui:define name="javascript">
            function controlaRadio(){
                var campo1 = document.getElementById("form:codCNPJ");
                var campo2 = document.getElementById("form:UF");
 

                if(document.getElementById("form:radio0").checked){
                    campo1.disabled=false;
                    campo2.disabled=true;
                 }
                 if(document.getElementById("form:radio1").checked){
                    campo1.disabled=true;
                    campo2.disabled=false;
                 }
            }

            function disable(){
                    document.getElementById("form:codCNPJ").disabled=true;
                    document.getElementById("form:UF").disabled=true;
            }
        </ui:define>
        <ui:define name="tituloH1">Consulta Participante</ui:define>
        <ui:define name="pagLinda">
            <h1>Selecione os filtros para sua pesquisa</h1>
            <h:messages layout="list" style="color: darkred"/>
            <h:form id="form">
                <br/>
                <h:selectBooleanCheckbox id="check" onchange="disableAll()"/>
                <h:outputText value="Não aplicar filtros - Pesquisar tudo"/>
                <br/>
                <h:commandButton value="Pesquisar" id="botao_em_cima" style="visibility: hidden"/>

                <h:panelGrid columns="2" id="painel">

                    <b>Código Familiar</b>
                    <h:inputText id="codFam" value="#{managedParticipante.participante.gf.codFamiliar}" label="Cod. Familiar">
                        <f:validateLength maximum="13"/>
                        <f:validateLongRange minimum="0"/>
                    </h:inputText>

                    <b>Codigo APF do empreendimento</b>
                    <h:inputText id="codApf" value="#{managedParticipante.participante.gf.emp.codigoComDigito}" label="Cod. APF">
                        <f:validator validatorId="validatorApf"/>
                    </h:inputText>

                    <b>Número do lote</b>
                    <h:inputText id="numLote" value="#{managedParticipante.participante.gf.insc.loteRemessa.numeroLote}" label="Num. do lote">
                        <f:validateLongRange minimum="0"/>
                    </h:inputText>

                    <b>Número da remessa</b>
                    <h:inputText id="numRem" value="#{managedParticipante.participante.gf.insc.loteRemessa.numeroRemessa}" label="Num. da Remessa">
                        <f:validateLongRange minimum="0" />
                    </h:inputText>
                    
                    <b>CPF</b>
                    <h:inputText id="codCPF" value="#{managedParticipante.participante.cpf}" label="CPF">
                        <f:validator validatorId="validatorCpf"/>
                    </h:inputText>

                    <b>NIS</b>
                    <h:inputText id="codNis" value="#{managedParticipante.participante.NIS}" label="NISa">
                        <f:validator validatorId="validatorNis"/>
                    </h:inputText>

                </h:panelGrid>
                <h:commandButton value="Pesquisar" id="botao_em_baixo"/>
            </h:form>
        </ui:define>
     </ui:composition>>
</html>
